package com.intct.hbase.ddl.service.impl;

import com.intct.hbase.ddl.service.AbstaractHBaseDDL;
import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.client.Admin;

import java.io.IOException;

/**
 * @author gufg
 * @since 2025-08-05 10:31
 */
public class CreateNamespaceImpl extends AbstaractHBaseDDL {
    @Override
    public void execCommand(Admin admin) {
        NamespaceDescriptor.Builder builder = NamespaceDescriptor.create("intct83_api_1");
        builder.addConfiguration("a", "b");

        try {
            admin.createNamespace(builder.build());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws IOException {
        CreateNamespaceImpl createNamespace = new CreateNamespaceImpl();
        createNamespace.start();
    }
}
